﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeBoundBlock3d : OdGeEntity3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeBoundBlock3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeBoundBlock3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeBoundBlock3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeBoundBlock3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeBoundBlock3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeBoundBlock3d() : this(GlobalsPINVOKE.new_OdGeBoundBlock3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock3d(OdGePoint3d arg0, OdGeVector3d side1, OdGeVector3d side2, OdGeVector3d side3) : this(GlobalsPINVOKE.new_OdGeBoundBlock3d__SWIG_1(OdGePoint3d.getCPtr(arg0), OdGeVector3d.getCPtr(side1), OdGeVector3d.getCPtr(side2), OdGeVector3d.getCPtr(side3)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock3d(OdGePoint3d point1, OdGePoint3d point2) : this(GlobalsPINVOKE.new_OdGeBoundBlock3d__SWIG_2(OdGePoint3d.getCPtr(point1), OdGePoint3d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock3d(OdGeBoundBlock3d source) : this(GlobalsPINVOKE.new_OdGeBoundBlock3d__SWIG_3(OdGeBoundBlock3d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getMinMaxPoints(OdGePoint3d p1, OdGePoint3d p2)
		{
			GlobalsPINVOKE.OdGeBoundBlock3d_getMinMaxPoints(this.swigCPtr, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void get(OdGePoint3d arg0, OdGeVector3d side1, OdGeVector3d side2, OdGeVector3d side3)
		{
			GlobalsPINVOKE.OdGeBoundBlock3d_get(this.swigCPtr, OdGePoint3d.getCPtr(arg0), OdGeVector3d.getCPtr(side1), OdGeVector3d.getCPtr(side2), OdGeVector3d.getCPtr(side3));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock3d set(OdGePoint3d p1, OdGePoint3d p2)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_set__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock3d set(OdGePoint3d arg0, OdGeVector3d side1, OdGeVector3d side2, OdGeVector3d side3)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_set__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(arg0), OdGeVector3d.getCPtr(side1), OdGeVector3d.getCPtr(side2), OdGeVector3d.getCPtr(side3)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock3d extend(OdGePoint3d point)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_extend(this.swigCPtr, OdGePoint3d.getCPtr(point)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock3d swell(double distance)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_swell(this.swigCPtr, distance), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock3d_contains__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock3d_contains__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeBoundBlock3d block, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock3d_isDisjoint__SWIG_0(this.swigCPtr, OdGeBoundBlock3d.getCPtr(block), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeBoundBlock3d block)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock3d_isDisjoint__SWIG_1(this.swigCPtr, OdGeBoundBlock3d.getCPtr(block));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isBox()
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock3d_isBox(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock3d setToBox(bool toBox)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_setToBox(this.swigCPtr, toBox), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock3d Assign(OdGeBoundBlock3d block)
		{
			OdGeBoundBlock3d result = new OdGeBoundBlock3d(GlobalsPINVOKE.OdGeBoundBlock3d_Assign(this.swigCPtr, OdGeBoundBlock3d.getCPtr(block)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d minPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeBoundBlock3d_minPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d maxPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeBoundBlock3d_maxPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d center()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeBoundBlock3d_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setToBoxOrtho(OdGeVector3d dir1, OdGeVector3d dir2, OdGeVector3d dir3)
		{
			GlobalsPINVOKE.OdGeBoundBlock3d_setToBoxOrtho__SWIG_0(this.swigCPtr, OdGeVector3d.getCPtr(dir1), OdGeVector3d.getCPtr(dir2), OdGeVector3d.getCPtr(dir3));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setToBoxOrtho()
		{
			GlobalsPINVOKE.OdGeBoundBlock3d_setToBoxOrtho__SWIG_1(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
